package com.zoffy.catdiarybackend.common;

public class BusinessException extends RuntimeException{
    private final int code;
    public BusinessException(int code,String message){
        super(message);
        this.code=code;
    }
    public BusinessException(StateCode stateCode,String message){
        super(message);
        this.code=stateCode.getCode();
    }
    public BusinessException(StateCode stateCode){
        super(stateCode.getMessage());
        this.code=stateCode.getCode();
    }

    public int getCode() {
        return code;
    }
}
